package com.example.mybatisdemo2.mapper;

import com.example.mybatisdemo2.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


@Mapper
public interface ArticleInfoMapper {

    @Select("select ta.*,tb.username,tb.age from articleinfo ta" +
            " left join userinfo tb on ta.uid = tb.id " +
            " where ta.id = #{id}")
    //报错(badSQL-->SQL语句格式问题) 单词之间要有空格,看日志里面的语句是否正确
    ArticleInfo queryArticleInfo(@Param("id")Integer articleId);
}
